/**
 * Copyright 2018-2019 jianggujin (www.jianggujin.com).
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.jianggujin.modulelink.support.annotation;

import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import com.jianggujin.modulelink.action.JAction;

/**
 * 用于标记该类为{@link JAction}，并自定义一些配置，使用该注解时可以不实现{@link JAction}接口
 * 
 * @author jianggujin
 *
 */
@Documented
@Retention(RUNTIME)
@Target(TYPE)
public @interface JActionComponent {
    /**
     * Action名称，默认类名首字母小写
     * 
     * @return
     */
    String name() default "";

    /**
     * Action描述
     * 
     * @return
     */
    String description() default "";

    /**
     * 默认方法，该方法的签名必须为：Object execute(Object
     * in)，优先级高于接口形式，如果不配置且未实现{@link JAction}接口则表示Action不支持默认方法
     * 
     * @return
     */
    String method() default "";

    /**
     * 是否为默认Action
     * 
     * @return
     */
    boolean isDefault() default false;

    /**
     * Action是否为默认的判断方法，优先级高于{@link #isDefault()}，如果返回数组不为空，则会与数组值匹配是否为默认Action
     * 
     * @return
     */
    String[] defaultModules() default {};
}
